package com.glory.erp.invoice.storedetail.dao.impl;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import com.glory.erp.invoice.storedetail.dao.StoreDetailDao;
import com.glory.erp.invoice.storedetail.bean.StoreDetail;
import com.glory.erp.invoice.storedetail.bean.StoreDetailQuery;
import com.glory.erp.auth.base.BaseDaoImpl;
import com.glory.erp.auth.base.BaseQueryModel;

public class StoreDetailDaoImpl extends BaseDaoImpl<StoreDetail> implements StoreDetailDao{

	public void doQbc(DetachedCriteria dc,BaseQueryModel qm){
		StoreDetailQuery sqm = (StoreDetailQuery)qm;
	}

	public StoreDetail findByStoreAndGoods(Long storeUuid, Long uuid) {
		String hql ="from StoreDetail where store.uuid = ? and goods.uuid = ?";
		List<StoreDetail> temp = this.getHibernateTemplate().find(hql, storeUuid,uuid);
		return temp.size() > 0 ? temp.get(0) : null;
	}
}